import React from 'react'
import axios from 'axios'
import {
    Form,
    Input,
    Button,
  } from 'antd-mobile'
function Index() {

    const onFinish =async (values: any) => {
        const res = await axios.post('/mock/login',values)
        console.log(res)
    }
  return (
    <div>
      <Form
        name='form'
        onFinish={onFinish}
        footer={
          <Button block type='submit' color='primary' size='large'>
            提交
          </Button>
        }
      >
       
        <Form.Item
          name='username'
          label='姓名'
          rules={[{ required: true, message: '姓名不能为空' }]}
        >
          <Input  placeholder='请输入姓名' />
        </Form.Item>

        <Form.Item
          name='password'
          label='密码'
          rules={[{ required: true, message: '密码不能为空' }]}
        >
          <Input  placeholder='请输入密码' />
        </Form.Item>
        
      </Form>

      
    </div>
  )
}

export default Index
